package cn.itcast.lock;

import java.util.concurrent.TimeUnit;

/**
 * @author 虎哥
 */
public interface RedisLock {
    /**
     * 获取锁
     * @param releaseTime 锁的自动释放时间
     * @return true:获取锁成功; false:获取锁失败
     */
    boolean tryLock(long releaseTime, TimeUnit timeUnit);

    /**
     * 释放锁
     */
    void unlock();
}
